package com.fawvwebanma.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fawvwebanma.entity.OrderList;
import com.fawvwebanma.mapper.OrderListMapper;

/**
 * @author jieye.ren
 * @date 2021/3/15
 */
@Component
public class OrderListDao {
    @Autowired
    OrderListMapper orderListMapper;

    public List<OrderList> getOrderlistNoPay(Map<String, Object> map) {
        QueryWrapper<OrderList> queryWrapper = new QueryWrapper<>();
        queryWrapper.allEq(map);
        return orderListMapper.selectList(queryWrapper);
    }

    public void updateOrderStatus(OrderList orderList) {
        orderListMapper.updateById(orderList);
    }

    public void saveOrderList(OrderList orderList) {
        orderListMapper.insert(orderList);
    }
}
